<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="th/m/include/head :: head(~{::title}, ~{::style})">
    <meta charset="utf-8">
    <title>表单域选择</title>
    <style>
        /*遮挡住 “没有更多记录了” */
        .mui-table-view, .mui-input-group {
            background-color: #fff !important;
        }

        .mui-input-row .input-icon {
            width: 50%;
            float: left;
        }

        .mui-input-row a {
            margin-right: 10px;
            float: right;
            text-align: left;
            line-height: 1.5;
        }

        .search_div {
            height: 40px;
            border-bottom: 1px solid gainsboro;
            margin-left: 15px;
            vertical-align: middle;
        }

        .search_div select {
            color: #007aff;
            height: 37px;
        }

        .search_div label {
            color: #aaa;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <h1 class="mui-title">请选择</h1>
    <a id='done' class="mui-btn mui-btn-link mui-pull-right mui-btn-blue ">完成</a>
</header>
<div id="pullrefresh" class="mui-scroll-wrapper" style="margin-top: 90px;">
    <div class="mui-scroll">
        <form class="search_form mui-input-group" id="search_content">

        </form>
        <!--数据列表-->
        <ul class="mui-table-view mui-table-view-chevron" id="form_field_ul">

        </ul>
    </div>
</div>
<script src="../../weixin/js/macro/open_window_macro.js"></script>
<script src="../../weixin/js/config.js"></script>
<script src="../../weixin/js/mui.module_list_sel.js"></script>
<script src="../../weixin/js/jquery.raty.min.js"></script>
<script th:inline="javascript">
    mui('.mui-scroll-wrapper').scroll({
        bounce: true, // 是否启用回弹
        indicators: true, //是否显示滚动条
        deceleration: 0.0006 //阻尼系数,系数越小滑动越灵敏，默认0.0006
    });

    var skey = [[${nav.skey}]];
    var params = {
        "skey": [[${nav.skey}]],
        "formCode": [[${formCode}]],
        "orderBy": [[${idField}]],
        "sort": "desc",
        "filter": "",
        "byFieldName": [[${idField}]],
        "showFieldName": [[${showField}]],
        "openerFormCode": [[${openerFormCode}]],
        "openerFieldName": [[${openerFieldName}]],
        "action": "afterGetClientValue"
    };

    var parentFields = [[${parentFields}]];
    if (parentFields != "") {
        var par = JSON.parse(parentFields);
        for (var o in par) {
            params[o] = par[o];
        }
    }
    var options = {
        "isWx":[[${isWx}]],
        "ulContainer": "#form_field_ul",
        "ajax_params": params,
        "url": AJAX_REQUEST_URL.MODULE_LIST_SEL,
        "ajaxDatasType": LIST_TYPE.FORM_FIELD
    };

    var content = document.querySelector('.mui-content');
    var PullToRefrshListApi = new mui.PullToRefrshList(content, options);
    PullToRefrshListApi.loadListData();

    $(function() {
        // 使搜索区域下方空白不致过大，而使下拉后的loadin图标显示出来
        $('#pullrefresh').css('margin-top', '40px');
    })
</script>
</body>
</html>